package com.javacoo.xservice.base.filter.xss;

import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Configuration;

import com.javacoo.xservice.base.support.auth.config.AuthConfig;

/**
 * XSS过滤器配置
 * <li></li>
 *
 * @author: duanyong@jccfc.com
 * @since: 2021/3/17 15:08
 */
@Configuration
@ConfigurationProperties(prefix = XSSFilterConfig.PREFIX)
@ConditionalOnProperty(prefix = XSSFilterConfig.PREFIX, value = AuthConfig.ENABLED, matchIfMissing = true)
public class XSSFilterConfig {
    public static final String PREFIX = "app.config.xss";
    /** 是否可用:,默认值*/
    public static final String ENABLED = "ENABLED";

    public static final String DEFAULT_URL = "/*";

    /**是否可用 */
    private String enabled = ENABLED;


    private String excludes;
    /** URL */
    private String urlPatterns = DEFAULT_URL;

    public String getEnabled() {
        return enabled;
    }

    public void setEnabled(String enabled) {
        this.enabled = enabled;
    }

    public String getExcludes() {
        return excludes;
    }

    public void setExcludes(String excludes) {
        this.excludes = excludes;
    }

    public String getUrlPatterns() {
        return urlPatterns;
    }

    public void setUrlPatterns(String urlPatterns) {
        this.urlPatterns = urlPatterns;
    }
}
